Constructs the options configuration to initialize a BPlusTree instance using the default Comparer for TKey
Syntax
Parameters
- keySerializer
- valueSerializer
Example
BPlusTree/BPlusTree.Test/TestBPlusTreeOptions.cs
C# | Copy Code |
---|
var options = new BPlusTree<int, int>.Options(PrimitiveSerializer.Int32, PrimitiveSerializer.Int32)
{
CreateFile = CreatePolicy.IfNeeded,
BTreeOrder = 4
};
var copy = options.Clone();
Assert.IsFalse(Object.ReferenceEquals(options, copy));
Assert.IsTrue(Object.ReferenceEquals(options.CallLevelLock, copy.CallLevelLock));
//If we get/set the lock prior to clone we will have the same lock instance.
options.CallLevelLock = new SimpleReadWriteLocking();
copy = options.Clone();
Assert.IsFalse(Object.ReferenceEquals(options, copy));
Assert.IsTrue(Object.ReferenceEquals(options.CallLevelLock, copy.CallLevelLock)); |
VB.NET | Copy Code |
---|
Dim options As var = New BPlusTree(Of Integer, Integer).Options(PrimitiveSerializer.Int32, PrimitiveSerializer.Int32) With { _
Key .CreateFile = CreatePolicy.IfNeeded, _
Key .BTreeOrder = 4 _
}
Dim copy As var = options.Clone()
Assert.IsFalse([Object].ReferenceEquals(options, copy))
Assert.IsTrue([Object].ReferenceEquals(options.CallLevelLock, copy.CallLevelLock))
'If we get/set the lock prior to clone we will have the same lock instance.
options.CallLevelLock = New SimpleReadWriteLocking()
copy = options.Clone()
Assert.IsFalse([Object].ReferenceEquals(options, copy))
Assert.IsTrue([Object].ReferenceEquals(options.CallLevelLock, copy.CallLevelLock)) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also